<?php
class preinfodao extends daobase {
 	public function updatePwd($oldPwd,$newPwd,$userId){
 		$sql = "select id from user where id ='$userId' and user_pwd='$oldPwd'";
 		//echo $sql;
 		$id = $this->fetchit($sql);
 		if (empty($id)){
 			return "oldpwdwrong";
 		}else{
	 		$sql = "update user set user_pwd='$newPwd' where id='$userId'";
	 		
	 		$update = $this->queryit($sql);
	 		if($update){
	 			return "ok";
	 		}
 		}
 	}
	public function getLastLogin($table,$colums,$condition){
		$lastLogin = $this->select($table,$colums)
					->where($condition)
					->fetchAll();
		//echo $this->sqlQuery;
		return $lastLogin[0];
	}
}